<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- map  foreach  some every  findindex -->
  <script>
    // foreach用来遍历数组 没有返回值
    // var arr = [10, 20, 30, 40, 50]
    // var a = arr.forEach(function (item) {
    //   console.log('item', item+100);
    // })
    // console.log('arr',arr);
    // console.log('a',a);

    // map用来遍历数组 有返回值
     var arr = [10, 20, 30, 40, 50]
    var a = arr.map(function (item) {
      console.log('item', item);
      return item+100
    })
    console.log('arr',arr);
    console.log('a',a);
  </script>
</body>

</html>